import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/alarm/all_alarm_records_entity.dart';

AllAlarmRecordsEntity $AllAlarmRecordsEntityFromJson(Map<String, dynamic> json) {
  final AllAlarmRecordsEntity allAlarmRecordsEntity = AllAlarmRecordsEntity();
  final String? alarmContent = jsonConvert.convert<String>(json['alarmContent']);
  if (alarmContent != null) {
    allAlarmRecordsEntity.alarmContent = alarmContent;
  }
  final String? alarmDevice = jsonConvert.convert<String>(json['alarmDevice']);
  if (alarmDevice != null) {
    allAlarmRecordsEntity.alarmDevice = alarmDevice;
  }
  final String? alarmInfo = jsonConvert.convert<String>(json['alarmInfo']);
  if (alarmInfo != null) {
    allAlarmRecordsEntity.alarmInfo = alarmInfo;
  }
  final String? alarmLevel = jsonConvert.convert<String>(json['alarmLevel']);
  if (alarmLevel != null) {
    allAlarmRecordsEntity.alarmLevel = alarmLevel;
  }
  final String? alarmModel = jsonConvert.convert<String>(json['alarmModel']);
  if (alarmModel != null) {
    allAlarmRecordsEntity.alarmModel = alarmModel;
  }
  final String? alarmTime = jsonConvert.convert<String>(json['alarmTime']);
  if (alarmTime != null) {
    allAlarmRecordsEntity.alarmTime = alarmTime;
  }
  final String? alarmType = jsonConvert.convert<String>(json['alarmType']);
  if (alarmType != null) {
    allAlarmRecordsEntity.alarmType = alarmType;
  }
  final int? alarmTypeCode = jsonConvert.convert<int>(json['alarmTypeCode']);
  if (alarmTypeCode != null) {
    allAlarmRecordsEntity.alarmTypeCode = alarmTypeCode;
  }
  final String? alarmTypeCodeName = jsonConvert.convert<String>(json['alarmTypeCodeName']);
  if (alarmTypeCodeName != null) {
    allAlarmRecordsEntity.alarmTypeCodeName = alarmTypeCodeName;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    allAlarmRecordsEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    allAlarmRecordsEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    allAlarmRecordsEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    allAlarmRecordsEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    allAlarmRecordsEntity.deleted = deleted;
  }
  final String? deviceTypeLabel = jsonConvert.convert<String>(json['deviceTypeLabel']);
  if (deviceTypeLabel != null) {
    allAlarmRecordsEntity.deviceTypeLabel = deviceTypeLabel;
  }
  final String? disposalContent = jsonConvert.convert<String>(json['disposalContent']);
  if (disposalContent != null) {
    allAlarmRecordsEntity.disposalContent = disposalContent;
  }
  final String? disposalControl = jsonConvert.convert<String>(json['disposalControl']);
  if (disposalControl != null) {
    allAlarmRecordsEntity.disposalControl = disposalControl;
  }
  final String? disposalDate = jsonConvert.convert<String>(json['disposalDate']);
  if (disposalDate != null) {
    allAlarmRecordsEntity.disposalDate = disposalDate;
  }
  final List<String>? disposalFilePath = (json['disposalFilePath'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (disposalFilePath != null) {
    allAlarmRecordsEntity.disposalFilePath = disposalFilePath;
  }
  final String? disposalStatus = jsonConvert.convert<String>(json['disposalStatus']);
  if (disposalStatus != null) {
    allAlarmRecordsEntity.disposalStatus = disposalStatus;
  }
  final String? equipName = jsonConvert.convert<String>(json['equipName']);
  if (equipName != null) {
    allAlarmRecordsEntity.equipName = equipName;
  }
  final String? filePath = jsonConvert.convert<String>(json['filePath']);
  if (filePath != null) {
    allAlarmRecordsEntity.filePath = filePath;
  }
  final String? hazardName = jsonConvert.convert<String>(json['hazardName']);
  if (hazardName != null) {
    allAlarmRecordsEntity.hazardName = hazardName;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    allAlarmRecordsEntity.id = id;
  }
  final String? numberCode = jsonConvert.convert<String>(json['numberCode']);
  if (numberCode != null) {
    allAlarmRecordsEntity.numberCode = numberCode;
  }
  return allAlarmRecordsEntity;
}

Map<String, dynamic> $AllAlarmRecordsEntityToJson(AllAlarmRecordsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['alarmContent'] = entity.alarmContent;
  data['alarmDevice'] = entity.alarmDevice;
  data['alarmInfo'] = entity.alarmInfo;
  data['alarmLevel'] = entity.alarmLevel;
  data['alarmModel'] = entity.alarmModel;
  data['alarmTime'] = entity.alarmTime;
  data['alarmType'] = entity.alarmType;
  data['alarmTypeCode'] = entity.alarmTypeCode;
  data['alarmTypeCodeName'] = entity.alarmTypeCodeName;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['deviceTypeLabel'] = entity.deviceTypeLabel;
  data['disposalContent'] = entity.disposalContent;
  data['disposalControl'] = entity.disposalControl;
  data['disposalDate'] = entity.disposalDate;
  data['disposalFilePath'] = entity.disposalFilePath;
  data['disposalStatus'] = entity.disposalStatus;
  data['equipName'] = entity.equipName;
  data['filePath'] = entity.filePath;
  data['hazardName'] = entity.hazardName;
  data['id'] = entity.id;
  data['numberCode'] = entity.numberCode;
  return data;
}

extension AllAlarmRecordsEntityExtension on AllAlarmRecordsEntity {
  AllAlarmRecordsEntity copyWith({
    String? alarmContent,
    String? alarmDevice,
    String? alarmInfo,
    String? alarmLevel,
    String? alarmModel,
    String? alarmTime,
    String? alarmType,
    int? alarmTypeCode,
    String? alarmTypeCodeName,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? deviceTypeLabel,
    String? disposalContent,
    String? disposalControl,
    String? disposalDate,
    List<String>? disposalFilePath,
    String? disposalStatus,
    String? equipName,
    String? filePath,
    String? hazardName,
    String? id,
    String? numberCode,
  }) {
    return AllAlarmRecordsEntity()
      ..alarmContent = alarmContent ?? this.alarmContent
      ..alarmDevice = alarmDevice ?? this.alarmDevice
      ..alarmInfo = alarmInfo ?? this.alarmInfo
      ..alarmLevel = alarmLevel ?? this.alarmLevel
      ..alarmModel = alarmModel ?? this.alarmModel
      ..alarmTime = alarmTime ?? this.alarmTime
      ..alarmType = alarmType ?? this.alarmType
      ..alarmTypeCode = alarmTypeCode ?? this.alarmTypeCode
      ..alarmTypeCodeName = alarmTypeCodeName ?? this.alarmTypeCodeName
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..deviceTypeLabel = deviceTypeLabel ?? this.deviceTypeLabel
      ..disposalContent = disposalContent ?? this.disposalContent
      ..disposalControl = disposalControl ?? this.disposalControl
      ..disposalDate = disposalDate ?? this.disposalDate
      ..disposalFilePath = disposalFilePath ?? this.disposalFilePath
      ..disposalStatus = disposalStatus ?? this.disposalStatus
      ..equipName = equipName ?? this.equipName
      ..filePath = filePath ?? this.filePath
      ..hazardName = hazardName ?? this.hazardName
      ..id = id ?? this.id
      ..numberCode = numberCode ?? this.numberCode;
  }
}
